//
//  ClassSetWithCell.m
//  GIFShow
//
//  Created by lanou11air029 on 15/4/24.
//  Copyright (c) 2015年 CK. All rights reserved.
//

#import "ClassSetWithCell.h"
#import "ClassLabelModel.h"
@interface ClassSetWithCell ()
@property (nonatomic, strong) UILabel * textTitleLabel;
//@property (nonatomic, strong) UIView * underView;
//@property (nonatomic) CGRect lastFrame;
@end
@implementation ClassSetWithCell

- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupSubViews];
    }
    return self;
}
-(void)setupSubViews{
    CGRect screenBounds = [UIScreen mainScreen].bounds;
//    CGFloat orignY = screenBounds.size.height * 0.09;
//    CGFloat btnHeight = screenBounds.size.height * 0.25;
    self.textTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, 100, screenBounds.size.height * 0.085)];
//    self.lastFrame = CGRectMake(0, 0, 0, 0);

    self.textTitleLabel.text = @"Gif分类管理";
    self.textTitleLabel.font = [UIFont systemFontOfSize:18];
    [self.contentView addSubview:self.textTitleLabel];
//    self.underView = [[UIView alloc]initWithFrame:CGRectMake(0, screenBounds.size.height*0.086, screenBounds.size.width, 480)];
//    [self.contentView addSubview:self.underView];
    
//        self.labelsArray = [NSMutableArray array];
//        
//        dispatch_async(dispatch_get_main_queue(), ^{
//            NSString * path = [[NSBundle mainBundle]pathForResource:@"LabelList" ofType:@""];
//            NSData * data = [NSData dataWithContentsOfFile:path];
//            NSDictionary * sourceDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
//            NSDictionary * jsonDic = sourceDic[@"result"];
//            for (NSDictionary * oneItem in jsonDic[@"hot"]) {
//                ClassLabelModel * classModel = [[ClassLabelModel alloc]init];
//                [classModel setValuesForKeysWithDictionary:oneItem];
//                [self.labelsArray addObject:classModel.label_content];
//            }
//            for (NSDictionary * oneItem in jsonDic[@"list"]) {
//                ClassLabelModel * classModel = [[ClassLabelModel alloc]init];
//                [classModel setValuesForKeysWithDictionary:oneItem];
//                [self.labelsArray addObject:classModel.label_content];
//            }
//            [self setupLabels];
//        });
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    CGFloat height = [UIScreen mainScreen].bounds.size.height;
    CGRect frame = self.contentView.frame;
    frame.size.width = [UIScreen mainScreen].bounds.size.width;
    if(selected){
        frame.size.height = height*0.64;
        [UIView animateWithDuration:0.4 animations:^{
            self.contentView.frame = frame;
            self.contentView.backgroundColor = [UIColor colorWithRed:0.95 green:1 blue:0.95 alpha:0.96];

        }];
      
        self.contentView.clipsToBounds = YES;
    }else{
        frame.size.height = height*0.085;
        [UIView animateWithDuration:0.4 animations:^{
            self.contentView.frame = frame;
//            self.contentView.backgroundColor = [UIColor whiteColor];
        }];
        self.contentView.clipsToBounds = YES;
    }

    // Configure the view for the selected state
}

@end
